package com.aplink.generic.pojo.controlspec.menu;

import java.util.ArrayList;

import android.widget.PopupMenu.OnMenuItemClickListener;

import com.aplink.generic.pojo.controlspec.ControlSpec;

public class PopupMenuSpec extends ControlSpec {
    private static final long serialVersionUID = -5615380294374927047L;
    private String mControlActive;
    private OnMenuItemClickListener mOnPopupMenuItemClick;
    private ArrayList<MenuItemSpec> mPopupMenuItems;

    public PopupMenuSpec() {
        this.mPopupMenuItems = new ArrayList<MenuItemSpec>();
    }

    public PopupMenuSpec(final String controlActive) {
        this();
        this.mControlActive = controlActive;
    }

    public PopupMenuSpec(final String controlActive,
            final ArrayList<MenuItemSpec> popupMenuItems) {
        this.mControlActive = controlActive;
        this.mPopupMenuItems = popupMenuItems;
    }

    public void add(final MenuItemSpec popupMenuItem) {
        this.mPopupMenuItems.add(popupMenuItem);
    }

    public String getControlActive() {
        return this.mControlActive;
    }

    public OnMenuItemClickListener getOnPopupMenuItemClick() {
        return this.mOnPopupMenuItemClick;
    }

    public ArrayList<MenuItemSpec> getPopupMenuItems() {
        return this.mPopupMenuItems;
    }

    public void setActiveControl(final String controlActive) {
        this.mControlActive = controlActive;
    }

    public void setMenuItems(final ArrayList<MenuItemSpec> popupMenuItems) {
        this.mPopupMenuItems = popupMenuItems;
    }

    public void setOnPopupMenuItemClick(
            final OnMenuItemClickListener onPopupMenuItemClick) {
        this.mOnPopupMenuItemClick = onPopupMenuItemClick;
    }

}
